package cate.game.role.task;

import cate.common.table.d.GDFunc;
import cate.common.table.task.row.AchievementRow;
import cate.game.role.RoleDependent;
import easy.java.dev.note.NoteClass;

import java.util.ArrayList;
import java.util.List;

@NoteClass("目标任务")
public class TargetTask extends RoleDependent {
    @Override
    public void onEnter() {
        update();
    }

    public void update() {
        TaskGroup group = role.getTask().getGroup(GDFunc.TARGET_TASK);
        List<Integer> taskIds = new ArrayList<>();
        for (AchievementRow aTpl : role.getGame().table.task.achievement.getList()) {
            taskIds.add(aTpl.taskId);
        }
        group.addItemListNoRepeat(taskIds);
    }
}
